{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=247
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var
	n,i,j:longint;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=0 to n do
	for j:=0 to n do
		if 3*i+5*j = n then begin
			write(i,' ',j);
			halt(0);
		end;
write('IMPOSSIBLE');
end.